home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / dial.z / dial
Encoding:
Text File  |  2002-10-03  |  7.3 KB  |  199 lines

  1.  
  2.  
  3.  
  4. DDDDIIIIAAAALLLL((((3333CCCC))))                                                              DDDDIIIIAAAALLLL((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      dial - establish an out-going terminal line connection
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddiiiiaaaallll....hhhh>>>>
  13.  
  14.      iiiinnnntttt ddddiiiiaaaallll ((((CCCCAAAALLLLLLLL ccccaaaallllllll))));;;;
  15.  
  16.      vvvvooooiiiidddd uuuunnnnddddiiiiaaaallll ((((iiiinnnntttt ffffdddd))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _d_i_a_l returns a file-descriptor for a terminal line open for read/write.
  20.      The argument to _d_i_a_l is a CALL structure (defined in the <_d_i_a_l._h> header
  21.      file).
  22.  
  23.      When finished with the terminal line, the calling program must invoke
  24.      _u_n_d_i_a_l to release the semaphore that has been set during the allocation
  25.      of the terminal device.
  26.  
  27.      The definition of CALL in the <_d_i_a_l._h> header file is:
  28.  
  29.      typedef struct {
  30.           struct termio *attr;   /* pointer to termio attribute struct */
  31.           int     baud;  /* transmission data rate */
  32.           int     speed; /* 212A modem: low=300, high=1200 */
  33.           char    *line; /* device name for out-going line */
  34.           char    *telno;        /* pointer to tel-no digits string */
  35.           int     modem; /* specify modem control for direct lines */
  36.           char    *device;       /*Will hold the name of the device used
  37.                          to make a connection */
  38.           int     dev_len;       /* The length of the device used to make
  39.                          connection */
  40.      } CALL;
  41.  
  42.      The CALL element _s_p_e_e_d is intended only for use with an outgoing dialed
  43.      call, in which case its value should be either 300 or 1200 to identify
  44.      the 113A modem, or the high- or low-speed setting on the 212A modem. Note
  45.      that the 113A modem or the low-speed setting of the 212A modem will
  46.      transmit at any rate between 0 and 300 bits per second. However, the
  47.      high-speed setting of the 212A modem transmits and receives at 1200 bits
  48.      per second only.  The CALL element _b_a_u_d is for the desired transmission
  49.      baud rate.  For example, one might set _b_a_u_d to 110 and _s_p_e_e_d to 300 (or
  50.      1200).  However, if ssssppppeeeeeeeedddd set to 1200 bbbbaaaauuuudddd must be set to high (1200).
  51.  
  52.      If the desired terminal line is a direct line, a string pointer to its
  53.      device-name should be placed in the _l_i_n_e element in the CALL structure.
  54.      Legal values for such terminal device names are kept in the _D_e_v_i_c_e_s file.
  55.      In this case, the value of the _b_a_u_d element need not be specified as it
  56.      will be determined from the _D_e_v_i_c_e_s file.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DDDDIIIIAAAALLLL((((3333CCCC))))                                                              DDDDIIIIAAAALLLL((((3333CCCC))))
  71.  
  72.  
  73.  
  74.      The _t_e_l_n_o element is for a pointer to a character string representing the
  75.      telephone number to be dialed.  The termination symbol will be supplied
  76.      by the _d_i_a_l function, and should not be included in the _t_e_l_n_o string
  77.      passed to _d_i_a_l in the CALL structure.
  78.  
  79.      The CALL element _m_o_d_e_m is used to specify modem control for direct lines.
  80.      This element should be non-zero if modem control is required.  The CALL
  81.      element _a_t_t_r is a pointer to a _t_e_r_m_i_o structure, as defined in the
  82.      _t_e_r_m_i_o._h header file.  A NULL value for this pointer element may be
  83.      passed to the _d_i_a_l function, but if such a structure is included, the
  84.      elements specified in it will be set for the outgoing terminal line
  85.      before the connection is established.  This is often important for
  86.      certain attributes such as parity and baud-rate.
  87.  
  88.      The CALL element _d_e_v_i_c_e is used to hold the device name (cul..) that
  89.      establishes the connection.
  90.  
  91.      The CALL element _d_e_v__l_e_n is the length of the device name that is copied
  92.      into the array device.
  93.  
  94. FFFFIIIILLLLEEEESSSS
  95.      /etc/uucp/Devices
  96.      /var/spool/locks/LCK.._t_t_y-_d_e_v_i_c_e
  97.  
  98. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  99.      alarm(2), read(2), write(2).
  100.      termio(7m).
  101.      uucp(1C).
  102.  
  103. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  104.      On failure, a negative value indicating the reason for the failure will
  105.      be returned.  Mnemonics for these negative indices as listed here are
  106.      defined in the <_d_i_a_l._h> header file.
  107.  
  108.           INTRPT  -1     /* interrupt occurred */
  109.           D_HUNG  -2     /* dialer hung (no return from write) */
  110.           NO_ANS  -3     /* no answer within 10 seconds */
  111.           ILL_BD  -4     /* illegal baud-rate */
  112.           A_PROB  -5     /* acu problem (open() failure) */
  113.           L_PROB  -6     /* line problem (open() failure) */
  114.           NO_Ldv  -7     /* can't open LDEVS file */
  115.           DV_NT_A -8     /* requested device not available */
  116.           DV_NT_K -9     /* requested device not known */
  117.           NO_BD_A -10    /* no device available at requested baud */
  118.           NO_BD_K -11    /* no device known at requested baud */
  119.  
  120. WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
  121.      Including the <<<<ddddiiiiaaaallll....hhhh>>>> header file automatically includes the <<<<tttteeeerrrrmmmmiiiioooo....hhhh>>>>
  122.      header file.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DDDDIIIIAAAALLLL((((3333CCCC))))                                                              DDDDIIIIAAAALLLL((((3333CCCC))))
  137.  
  138.  
  139.  
  140.      The above routine uses <<<<ssssttttddddiiiioooo....hhhh>>>>, which causes it to increase the size of
  141.      programs, not otherwise using standard I/O, more than might be expected.
  142.  
  143. BBBBUUUUGGGGSSSS
  144.      An _a_l_a_r_m(2) system call for 3600 seconds is made (and caught) within the
  145.      _d_i_a_l module for the purpose of ``touching'' the _L_C_K.. file and
  146.      constitutes the device allocation semaphore for the terminal device.
  147.      Otherwise, _u_u_c_p(1C) may simply delete the _L_C_K.. entry on its 90-minute
  148.      clean-up rounds.  The alarm may go off while the user program is in a
  149.      _r_e_a_d(2) or _w_r_i_t_e(2) system call, causing an apparent error return.  If
  150.      the user program expects to be around for an hour or more, error returns
  151.      from _r_e_a_ds should be checked for ((((eeeerrrrrrrrnnnnoooo========EEEEIIIINNNNTTTTRRRR)))), and the _r_e_a_d possibly
  152.      reissued.
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.